<include file="public@header" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/zoomify.min.css">
</head>
<body>
	<div class="wrap js-check-wrap">		
		<form class="well form-inline margin-top-20" method="post" action="{:url('StoreGoods/index')}">
            商品名:
         <input type="text" class="form-control" name="g_goodsname" style="width: 120px;" value="{:input('request.g_goodsname/s','')}" placeholder="请输入商品名">          
           商品状态:<php>$status=get_good_status();</php>
        <select class="form-control" name="status" style="width: 140px;">
            <option value='quanbu'>全部</option>
            <foreach name="status" item="v" key='k'>
            <option value='{$k}'>{$v}</option>
            </foreach>
        </select> &nbsp;&nbsp;
         <input type="submit" class="btn btn-primary" value="搜索" />
         <a class="btn btn-danger" href="{:url('StoreGoods/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>				
				<tr>
					<th width="40">ID</th>					
					<th align="left">商品名称</th>					
					<th align="left">所属类别</th>
					<th align="left">添加时间</th>
					<th align="left">修改时间</th>					
					<th align="left">图片</th>
					<th align="left">状态</th>
					<th width="160">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="list" item="vo">				
				<tr>
					<td>{$vo.g_id}</td>
					<td>{$vo.g_goodsname}</td>					
					<td>{$vo['g_category']|getCname}</td>
					<td>{$vo.g_ctime|time_format}</td>
					<td>{$vo.g_utime||time_format}</td>					
					<td>
						<div class="example col-xs-6 col-md-6">
						<p><img src="__ROOT__/upload/{$vo.g_pic}" class="img-rounded" alt="" width='50' height='50'></p>
						</div>
					</td>
					<td>
					<if condition="$vo['g_status'] eq 0"><span style="color:#E74C3C">下架</span><elseif condition="$vo['g_status'] eq -1"/><span style="color:#00DDDD">审核中</span><else/><span style="color:#18BC9C">上架</span></if>
					</td>
					<td>
						<if condition="$vo['g_status'] eq 1">
                            <a class="js-ajax-dialog-btn"
                               href="{:url('StoreGoods/upStatus',['g_id'=>$vo['g_id'],'g_status'=>0])}">下架</a>
                            <else/>
                            <a class="js-ajax-dialog-btn"
                               href="{:url('StoreGoods/upStatus',['g_id'=>$vo['g_id'] ,'g_status'=>1])}">上架</a>
                         </if>
						<a href="{:url('StoreGoods/edit',array('g_id'=>$vo['g_id']))}">{:lang('EDIT')}</a>
						<!-- <a class="js-ajax-delete" href="{:url('Goods/delete',array('g_id'=>$vo['g_id']))}">{:lang('DELETE')}</a> -->					
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__TMPL__/public/assets/js/zoomify.min.js"></script>
	<script type="text/javascript">
		$('.example img').zoomify();
	</script>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>